﻿#include "Surole.h"
#include <iostream>
#include <conio.h>
#include <Windows.h>
using namespace std;

Surole::Surole() { }

Surole::Surole(double hp, double atk, string name, vector<string> say, int id) :
	Role(hp, atk, name), say(say), id(id) {}

Surole::Surole(string name, vector<string> say, int id) : Role(name), say(say), id(id) { }

int Surole::get_id() const {
	return id;
}

void Surole::chat_Hero() {
	for (int i = 0;i < say.size();i++) {
		auto Theresay = say.begin() + i;
		string say1 = *Theresay;
		for (int j = 0;j < say1.length();j++) {
			cout << say1[j];
			if (!_kbhit()) {
				Sleep(25);
			}
		}
		cout << endl;
	}
	isChat = true;
	system("pause");
}

void Surole::change(string name, vector<string> s, int i) {
	set_name(name);
	say = s;
	id = i;
}

void Surole::change(double hp, double atk, string name, vector<string> s, int i) {
	set_hp(hp);
	set_atk(atk);
	set_name(name);
	say = s;
	id = i;
}

bool Surole::isChated(){
	return isChat;
}